package com.mapproject.industrymap.controller;

import com.alibaba.fastjson.JSONObject;
import com.mapproject.industrymap.service.GeoserverRequestInfoService;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/geoinfo")
public class GeoserverRequestInfoController {
    @Value("${file.uploadFolder}")
    private String uploadFolder;
    @Value("${file.projectFileDir}")
    private String projectFileDir;
    @Autowired
    GeoserverRequestInfoService geoserverRequestInfoService;
    @RequestMapping(value = "/getStyle")
    public ReturnValue getStyle(@RequestParam(value = "layername") String layername)  {

        return geoserverRequestInfoService.getStyle(uploadFolder+projectFileDir+layername+".sld");
    }
}
